from alg import Solution
from gen import generate_test_cases


def test_solution():
    sol = Solution()
    test_cases = [
        ([1, 1, 2], 5),
        ([10, 10, 10], 11),
        ([], 0),
        ([0], 1),
        ([1, 1, 1, 1], 4),
    ]

    for i, (answers, expected) in enumerate(test_cases):
        result = sol.numRabbits(answers)
        assert result == expected, f"Test Case {i + 1} Failed: Expected {expected}, Got {result}"
        print(f"Test Case {i + 1} Passed: {answers} -> {result}")

    print("\nRunning Random Test Cases...")
    random_test_cases = generate_test_cases()
    for i, case in enumerate(random_test_cases):
        result = sol.numRabbits(case)
        print(f"Random Test Case {i + 1}: {case} -> {result}")


if __name__ == "__main__":
    test_solution()